TARBALL = yawt.tar.gz
EXECUTABLES = bin/regread.exe bin/unzip.exe bin/cabextract.exe
export CC = i586-mingw32msvc-gcc

.PHONY : all clean distclean tarball

all: ${EXECUTABLES}

bin/regread.exe:
	(cd src/regread && make)
	cp src/regread/regread.exe bin/

bin/unzip.exe:
	(cd src/unzip-5.52 && make -f win32/Makefile.gcc)
	cp src/unzip-5.52/unzip.exe bin/

bin/cabextract.exe:
	(cd src/cabextract-1.2 && make)
	cp src/cabextract-1.2/cabextract.exe bin/

clean:
	(cd src/regread && make clean)
	(cd src/unzip-5.52 && make -f win32/Makefile.gcc clean)
	(cd src/cabextract-1.2 && make clean)
	rm -f ${EXECUTABLES} ${TARBALL}

distclean:
	(cd src/regread && make distclean)
	(cd src/unzip-5.52 && make -f win32/Makefile.gcc clean)
	(cd src/cabextract-1.2 && make distclean)
	rm -f ${EXECUTABLES} ${TARBALL}

tarball: bin/regread.exe bin/unzip.exe bin/cabextract.exe
	tar zcf ${TARBALL} Makefile README yawt.py yawt_test.py bin/ src/ \
	  tests/
